/**
 * 园区管理 接口
 */
import request from "../request"

// 获取设备信息
export function getdevInfo(id) {
  return request({
    url: `/property/stake/${id}`,
    method: 'get',
  })
}
// 获取故障信息列表
export function getFaultInfo(data) {
  return request({
    url: `/operation/alarmRec/queryPage`,
    method: 'post',
    data: data || {}
  })
}
// 头部卡片信息
export function getRealTimeInfoCharing(id) {
  return request({
    url: `/operate/pileMonitoring/getRealTimeInfoCharing/${id}`,
    method: 'get',
  })
}

// 仪表盘数据
export function getPanelInfo(id) {
  return request({
    url: `/operate/pileMonitoring/getRealTimeInformationt/${id}`,
    method: 'get',
  })
}

// 获取工单信息列表
export function getWorkSheetInfo(id) {
  return request({
    url: `/operation/workSheetDev/queryFailWorkSheet/${id}`,
    method: 'get',
  })
}
// 柱状折线图数据
export function getCharingInfo(id) {
  return request({
    url: `/operate/pileMonitoring/getRealTimeVoltageCurrentToTimes/${id}`,
    method: 'get',
  })
}
// 当日充电记录
export function getStaList(id) {
  return request({
    url: `/charge/chagRec/queryChagRecListByDevId/${id}`,
    method: 'get',
  })
}

//省市区选择框
export function sxqxzk() {
  return request({
    url: `/system/region/getRegionTree?id=-1`,
    method: 'get',
  })
}
//根据充电站ID获取充电站详情
export function getDetails(id) {
  return request({
    url: `/property/station/getDetails/${id}`,
    method: 'get',
  })
}

// 获取所有信息站点集合
export function queryByConditions(data) {
  return request({
    url: '/property/station/queryByConditions',
    method: 'post',
    data: data || {}
  })
}

// 地图站点聚合
export function mapSiteAggregation(data) {
  return request({
    url: '/operate/multiplestaMonitoring/mapSiteAggregation',
    method: 'post',
    data: data || {}
  })
}

//站点实时状态
export function queryDevRealStatus(staId) {
  return request({
    url: `/operate/panoramicMonitoring/queryDevRealStatus/${staId}`,
    method: 'get',
  })
}
//实时功率表
export function queryPLineTodayByRegId(regId) {
  return request({
    url: `/charge/hisCurveRegion/queryPLineTodayByRegId/${regId}`,
    method: 'get',
  })
}

//实时功率表
export function queryGroupDataByRegId(orgId) {
  return request({
    url: `system/group/${orgId}`,
    method: 'get',
    async: false
  })
}

// 站点信息
export function getQueryByPage(data) {
  return request({
    url: '/property/station/getStations',
    method: 'post',
    async: false,
    data: data || {}
  })
}

// 根据parentId(充电桩的id)获取充电枪
export function getConnsByParentId(data) {
  return request({
    url: '/property/connector/getConnsByParentId/' + data,
    method: 'get'
  })
}

// 根据枪Id获取卡号
export function queryChargingCardId(data) {
  return request({
    url: '/chargepole/chargepole/queryChargingCardId',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
    },
    method: 'post',
    data: data || {}
  })
}

// 关闭充电枪
export function servtopCharge(data) {
  return request({
    url: '/chargepole/chargepole/serv_stopCharge',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
    },
    method: 'post',
    data: data || {}
  })
}
export function queryChargingGunStatus(data) {
  return request({
    url: '/charge/staCharStaDay/chargingGunStatus/' + data,
    method: 'get',
  })
}
export function servPwmControl(data) {
  return request({
    url: '/chargepole/chargepole/serv_pwmControl',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
    },
    method: 'post',
    data: data || {}
  })
}